using System.Collections.Generic;
using Managistics.Model;
using Managistics.Model.ValueObject;
using System;

namespace Managistics.Core.Services
{
    public interface IPurchaseOrderService
    {
        List<PurchaseOrder> GetPurchaseOrders(PurchaseOrderParam p);
        List<PurchaseOrderDetail> GetPurchaseOrderDetails(string p);
        List<InputSheet> GetInputSheetsByOrder(string Orderid);
        List<InputSheetDetailRecord> GetInputSheetDetails(string orderId, string inputSheetId);
        void SaveInputSheet(InputSheetParam vo);
        void DeleteInputSheet(string inputSheetId);
    }

    ///
    /// =======================================================================================
    /// Result objects
    /// =======================================================================================
    ///
    # region Result objects

    public class InputedQuantityRecord
    {
        public string ItemId { get; set; }
        public float? Quantity { get; set; }
    }
    
    public class InputSheetDetailRecord
    {
        public double Id { get; set; }
        public string GoodCode { get; set; }
        public DateTime Ordered { get; set; }
        public double Existing { get; set; }
        public string Input { get; set; }
        public string Unit { get; set; }
        public string Name { get; set; }
    }

    # endregion

    ///
    /// =======================================================================================
    /// Object parameters
    /// =======================================================================================
    ///
    # region Object parameter

    public class InputSheetParam
    {
        public PurchaseOrder PurchaseOrder { get; set; }
        public string InputSheetId { get; set; }
        public DateTime InputedDate { get; set; }
        public string Deliver { get; set; }
        public string Receiver { get; set; }
        public string Description { get; set; }
        public List<InputSheetDetailRecord> ListInputSheetDetails { get; set; }
        public List<InputSheetDetailRecord> ListInputSheetDetailRemoves { get; set; }
    }

    public class PurchaseOrderParam : BaseParam
    {
        public string StartDate { get; set; }
        public string EndDate { get; set; }
        public string Id { get; set; }
        public string SupplierId { get; set; }
        public string GoodCode { get; set; }
        public string GoodName { get; set; }
        public string SupplierName { get; set; }
    }
    # endregion
}